UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'IUINLoBU9nP+EPJl/sLEo37ak4iwpBaxag/NRjJTJCc='
WHERE
key_id = 'cf82ec8f0b7e1f5fbc39c4b7789b76af51e72720e76d61fdb9c6b088ed5413aa'
AND (
token = 'IUINLoBU9nP+EPJl/sLEo37ak4iwpBaxag/NRjJTJCc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)