UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'dOJjrrIaC70S04Mn0vNO1+GItwZJKdAIpv/eI+TgKSo=' 
WHERE 
  key_id = 'ecff2746d7d14a38fb6143ba8630e9267f5074f0354ff34f92cf4fa772d5bde4' 
  AND (
    token = 'dOJjrrIaC70S04Mn0vNO1+GItwZJKdAIpv/eI+TgKSo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028