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