UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'SOHcPZxV0hocvU/wlGcGEho+omXPzuEG2/auu9xP1Oo=' 
WHERE 
  key_id = '4320291ee414ea0e393a4799c28be64bf26fb29fe5b7d7fc6faa2f4cbd7bd683' 
  AND (
    token = 'SOHcPZxV0hocvU/wlGcGEho+omXPzuEG2/auu9xP1Oo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028