UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'b0QfV7Z3qdrydlsnVh6fw8AFc2WidC1cTCvQmAlrEpQ='
WHERE
key_id = 'acd0dfa8419ae03158d8b50a43d72ff0e4777b9e4d6ef5272891b9b3956db2c1'
AND (
token = 'b0QfV7Z3qdrydlsnVh6fw8AFc2WidC1cTCvQmAlrEpQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)