UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ybEAt9hyAKYyO+CXvh4+sDM4GF6DxXphWn+d1TNYRYQ='
WHERE
key_id = 'a41d084ef43abe04edbff51e643811ba6a224dcc3a53dc668bb60474b2348224'
AND (
token = 'ybEAt9hyAKYyO+CXvh4+sDM4GF6DxXphWn+d1TNYRYQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)