UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '9Hj9gcJwMuiff2AzxW9ZiwcQ9TpjstXs9kqVUClXvig='
WHERE
key_id = 'cf4b73db4b68c386dcd90346a2e1ad6b6b930212a6b73fdc8fa2e677871c2f11'
AND (
token = '9Hj9gcJwMuiff2AzxW9ZiwcQ9TpjstXs9kqVUClXvig='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)