UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'RriH+UbnJuCqtRbEcJQ5unaJQO+tLveyJ4PvN1yxHxs=' 
WHERE 
  key_id = '15f1b8b25e30c79458ef87fb8ee169654c3d4cad2e275d76eee4251856442bc4' 
  AND (
    token = 'RriH+UbnJuCqtRbEcJQ5unaJQO+tLveyJ4PvN1yxHxs=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00039