UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'q7HnEistCPoyklVcJPDSO05mFxYAgVWmhmV1gxXYJ0c='
WHERE
key_id = '646074c1fbc8009ffde68fbd3a08b87b5c339f237153b6f16515dcdc86cb829f'
AND (
token = 'q7HnEistCPoyklVcJPDSO05mFxYAgVWmhmV1gxXYJ0c='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)