UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'dxWmH4DL7608w5csyDVAcxTpeUduyZTLnlP/6v/BbmU='
WHERE
key_id = 'da0e90ab91ed05312ba5585b8d51e66e3b732f0dc3f1326614dee4946adf43d8'
AND (
token = 'dxWmH4DL7608w5csyDVAcxTpeUduyZTLnlP/6v/BbmU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)