UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Evx99I1NLcd2R/rAPYdDUlFvb84rVMndb+JFtn2lmy0='
WHERE
key_id = 'b42f5b7f8c4f340f25ed50b465793839a4d4e871d217a0209e0b6edaa8f3b001'
AND (
token = 'Evx99I1NLcd2R/rAPYdDUlFvb84rVMndb+JFtn2lmy0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)