UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'vgMaeeZpgeIUixM5cDX5sNWIRFDYpE2B2nwTqyY1LW4=' 
WHERE 
  key_id = 'df7a624f41a9fd7ea4110a140fcd9801929d4b1d8904e2020f28ef80ca36b1b8' 
  AND (
    token = 'vgMaeeZpgeIUixM5cDX5sNWIRFDYpE2B2nwTqyY1LW4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00042