UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'yL4BYpC7YjhO2T0AmMqJWbG3R1Kmf/oTFgFxkntT1WQ=' 
WHERE 
  key_id = '860303b63fd446f638e426df5567b565f39210e46430e22731180cac4180383a' 
  AND (
    token = 'yL4BYpC7YjhO2T0AmMqJWbG3R1Kmf/oTFgFxkntT1WQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033