UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'zYHcDyGjDyvWYf/Mk5mVGu6TK/1Nfe+JbK68eifzxY4=' 
WHERE 
  key_id = '18f3da9aad56a9c09cdc174b0494fdf35d166ab699abeb1c0861a23b0a95d52e' 
  AND (
    token = 'zYHcDyGjDyvWYf/Mk5mVGu6TK/1Nfe+JbK68eifzxY4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00076