UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'p+GYj6jzm8vMOoUTzWp1M6aL2/JYCSFqR08ChAunw94=' 
WHERE 
  key_id = '68f2a6b9b27e88a3f0e1a5f4674a471ddf842b8157cdd2c34f9c136a93f7aa0a' 
  AND (
    token = 'p+GYj6jzm8vMOoUTzWp1M6aL2/JYCSFqR08ChAunw94=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028