UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'RvAafhnT+/SkcI1pJKSlCXgH3iXm5EzSKQmeOG6XDWI='
WHERE
key_id = '89a0f698373d264e1759f4e296d04eab7b459e12df986e0dd98556a54f37307f'
AND (
token = 'RvAafhnT+/SkcI1pJKSlCXgH3iXm5EzSKQmeOG6XDWI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)