UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'FyjFtR0+ZS+qaoAAHElHAw2fhYTXRX8rQxbT9kZLVsw=' 
WHERE 
  key_id = 'fcd60f9df4e33bdf568876e69df256265c6fd632179da8bb42ca9c4ca324b2c3' 
  AND (
    token = 'FyjFtR0+ZS+qaoAAHElHAw2fhYTXRX8rQxbT9kZLVsw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00039