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

Query time 0.00032