UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'gcfurJ7E52+ScExDcjgDj2h+nw2zm7g5IK/pB22ZvaI='
WHERE
key_id = 'e4f74b3f2a105b5aa2874e3ebc8ce3b146006f6e6b581ed59442cfd3d4246c42'
AND (
token = 'gcfurJ7E52+ScExDcjgDj2h+nw2zm7g5IK/pB22ZvaI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)