UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '78aolpyo8w/1cze6iKsv2+zH2x5pgw7Z25xY08fzqL8='
WHERE
key_id = '8bcdf0ded88a66304e8c145c005c1d6bbce5fba5a24601e60a787f9aeb2efdca'
AND (
token = '78aolpyo8w/1cze6iKsv2+zH2x5pgw7Z25xY08fzqL8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)