UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'CH5MfLQjGQvbvupEQSUijRzr7e4k76NRnxiFHqi8hXQ='
WHERE
key_id = '4e6d7bffef3f63345f1b3d43956650249100bf23fe5ed0977fa720c89dc45f53'
AND (
token = 'CH5MfLQjGQvbvupEQSUijRzr7e4k76NRnxiFHqi8hXQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)