UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '1PRq28Wf/0t+xhKjIYoxtWPBgeUL7aX8LPFY38tYKio='
WHERE
key_id = 'ea07f87182ff005e9084309004c860eb51e277cd22b8383878c6866ca7a07658'
AND (
token = '1PRq28Wf/0t+xhKjIYoxtWPBgeUL7aX8LPFY38tYKio='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)