UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'tiHWTV4pnRlsVlAL7dGxyOvWBZsbFPZFLXw8l+253Dw='
WHERE
key_id = '7f72b4105d7114bcb45c6241945d8e510cfb0b879f1b6f2497f03a24ff732125'
AND (
token = 'tiHWTV4pnRlsVlAL7dGxyOvWBZsbFPZFLXw8l+253Dw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)