UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'VeR6HoKM/8eGrywh7b0EaN2ReUYWtVRVjYEzSaoNcrw='
WHERE
key_id = 'dd4f8893e9db5a5ff33ee53a46ef2a9c3dcaced77d4cf1d171451c1ae1230c4e'
AND (
token = 'VeR6HoKM/8eGrywh7b0EaN2ReUYWtVRVjYEzSaoNcrw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)