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