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

Query time 0.00023