UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'xsu/u6/2vNGlMCW0WzhvAm+rw55bK5AjZaAHO74t9To='
WHERE
key_id = '66c0a52afd0e8adba9adc54af24fca97ad5f1b0fcd83fb5759a7bf8d2b173046'
AND (
token = 'xsu/u6/2vNGlMCW0WzhvAm+rw55bK5AjZaAHO74t9To='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)