UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '6t3K/ZI3DYmGOurxixDiP5PY7rEbIQltopN4nmY6o3k=' 
WHERE 
  key_id = '271b65fde1bc73ce530e0125b43aaf9783dabcffac97c111329788cea2495b51' 
  AND (
    token = '6t3K/ZI3DYmGOurxixDiP5PY7rEbIQltopN4nmY6o3k=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029