UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'O681550WogrFNU1Tup1UDD3KNmElgq94qFU4spLkDmA='
WHERE
key_id = '59be0ff183fdb3813ccf3a8867acdfe47eb3303a7edecc897d418d5ad53d8d77'
AND (
token = 'O681550WogrFNU1Tup1UDD3KNmElgq94qFU4spLkDmA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)