UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'UC+xok2KPrOuKAKusIhHe9ovtTu01OXc2YLaNXFhWk4='
WHERE
key_id = 'd2cec2b31913748f7a150b7845b7e201d22e0aeaaed3780366ede0c3bf1f0d86'
AND (
token = 'UC+xok2KPrOuKAKusIhHe9ovtTu01OXc2YLaNXFhWk4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)