UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'KczMZEwTXqRBXvVAuAFvmKH8Fxt96h+Ye3BTdHwCf44=' 
WHERE 
  key_id = '0108f12e233d4a57e2d21589ebb8dddad3e806adfb3d11d06f1cb473b3445206' 
  AND (
    token = 'KczMZEwTXqRBXvVAuAFvmKH8Fxt96h+Ye3BTdHwCf44=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00021