UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Qz/O/akliQJWG4qN5KUVUY2jSxeiN4xuJbkz+zIYamY='
WHERE
key_id = '7ebfdc243ececf1953829b5c59a274a265ad4cff3d7668718485e0bbb663bbab'
AND (
token = 'Qz/O/akliQJWG4qN5KUVUY2jSxeiN4xuJbkz+zIYamY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)