UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Wiq7dpBSMUoPEZ5jaMBqQSGn0HYiGzXdK/nkl6kXttU='
WHERE
key_id = '1861ea4ceefa0983052a4b96672e31073e1645dc3d02140c2607c8857e4243f2'
AND (
token = 'Wiq7dpBSMUoPEZ5jaMBqQSGn0HYiGzXdK/nkl6kXttU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)